home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / HyperCuber Source / HyperCuber 2.0 Source.sit / HyperCuber 2.0 Source / CMouseControlsArrayPane.cp < prev    next >
Text File  |  1994-04-06  |  3KB  |  107 lines

  1. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. //| CMouseControlsArrayPane.cp
  3. //|
  4. //| This implements the scrolling list in the mouse controls
  5. //| window.
  6. //|_________________________________________________________
  7.  
  8.  
  9. #include "CMouseControlsArrayPane.h"
  10. #include "Mouse.h"
  11.  
  12. #include <stdio.h>
  13. #include <string.h>
  14.  
  15.  
  16. //======================== Prototypes ======================\\
  17.  
  18. extern void DrawModifiers(short modifiers, short h, short v);
  19.  
  20.  
  21.  
  22. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. //| CMouseControlsArrayPane::IMouseControlsArrayPane
  24. //|
  25. //| Purpose: Initialize the mouse controls array pane.
  26. //|
  27. //| Parameters: passed to superclass
  28. //|______________________________________________________________________________
  29.  
  30. void CMouseControlsArrayPane::IMouseControlsArrayPane(CView *anEnclosure,
  31.                             CBureaucrat *aSupervisor,
  32.                             short aWidth, short aHeight,
  33.                             short aHEncl, short aVEncl,
  34.                             SizingOption aHSizing, SizingOption aVSizing)
  35. {
  36.  
  37.     CArrayPane::IArrayPane(anEnclosure, aSupervisor, aWidth,
  38.                             aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
  39.  
  40. }    //==== CMouseControlsArrayPane::IMouseControlsArrayPane() ====\\
  41.  
  42.  
  43.  
  44. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. //| CMouseControlsArrayPane::DrawCell
  46. //|
  47. //| Purpose: Initialize the about dialog.
  48. //|
  49. //| Parameters: cell: the cell to draw
  50. //|             rect: rectangle of the cell
  51. //|______________________________________________________________________________
  52.  
  53. void CMouseControlsArrayPane::DrawCell(Cell cell, Rect *rect)
  54. {
  55.  
  56.     mouse_control_struct mouse_control;
  57.     itsArray->GetItem(&mouse_control, cell.v+1);        //  Get the mouse_control control
  58.  
  59.     char table_string[100];
  60.  
  61.     char angle_string[5];
  62.     if (mouse_control.angle == 0)                        //  Build the angle string
  63.         strcpy(angle_string, "P");
  64.     else
  65.         sprintf(angle_string, "%d", mouse_control.angle);
  66.  
  67.     sprintf(table_string, "Track [%d:%s] %s",            //  Build the description string
  68.             mouse_control.dimension, angle_string,
  69.             mouse_control.horiz ?
  70.                     "horizontally" : "vertically");
  71.     
  72.     TextFont(systemFont);                                //  Set font to Chicago
  73.     MoveTo(rect->left+3, rect->bottom-5);
  74.     DrawString(CtoPstr(table_string));                    //  Display the description string
  75.  
  76.     char multiplier_string[10];                            //  Draw the multiplier string
  77.     if (mouse_control.multiplier != 1)
  78.         {
  79.         DrawString("\p (");
  80.         Move(2, -2);
  81.         TextFont(monaco);
  82.         TextSize(9);
  83.         DrawChar('x');
  84.         Move(2, 2);
  85.         TextFont(systemFont);
  86.         TextSize(12);
  87.         sprintf(multiplier_string, "%d)",
  88.                     mouse_control.multiplier);
  89.         DrawString(CtoPstr(multiplier_string)
  90.         );
  91.         }
  92.  
  93.     if (mouse_control.modifiers)    
  94.         DrawModifiers(mouse_control.modifiers, 280,
  95.                                     rect->bottom-14);    //  Draw the modifiers
  96.     else
  97.         {
  98.         MoveTo(250, rect->bottom-5);                    //  No modifiers; draw "none"
  99.         TextFont(systemFont);
  100.         DrawString("\pnone");
  101.         TextFont(applFont);
  102.         }
  103.  
  104.     TextFont(applFont);                                    //  Switch back to application font
  105.  
  106. }    //==== CMouseControlsArrayPane::DrawCell() ====\\
  107.